import { _decorator, Component, Node, tween, Vec2, Vec3 } from 'cc';
import { Card } from '../Card';
const { ccclass, property } = _decorator;

@ccclass('CardListUI')
export class CardListUI extends Component {
    @property({type:[Card]})
    cardsList: Array<Card> = [];

    protected start(): void {
        this.disableCardList();
        // this.showCardList();
    }
    showCardList(){
        tween(this.node)
        // 将当前节点位置动画移动到中间节点位置
        .to(3, { position: new Vec3(-95,315,0) }, { easing: 'bounceInOut' })
        // 启动动画
        .start();
        this.enableCardList();
    }
    disableCardList(){
        for(let card of this.cardsList){
            card.disableCard();
        }
    }
    enableCardList(){
        for(let card of this.cardsList){
            card.enableCard();
        }
    }
}


